package net.wanho.ems.controller;

import com.github.pagehelper.PageInfo;
import lombok.RequiredArgsConstructor;
import net.wanho.ems.entity.Emp;
import net.wanho.ems.entity.User;
import net.wanho.ems.service.EmpService;
import net.wanho.ems.vo.AjaxResult;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * Author：汤小洋
 * Date：2023-07-11 16:55
 * Description：<描述>
 */
@RestController
@RequestMapping("/emp")
@RequiredArgsConstructor
public class EmpController {

    private final EmpService empService;

    @RequestMapping("/list")
    public AjaxResult list(Integer page, Integer limit, Emp emp){
        PageInfo<Emp> pageInfo = empService.list(page,limit,emp);
        return AjaxResult.success(pageInfo.getList(),pageInfo.getTotal());
    }

}
